home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / math / gle-3.000 / gle-3 / gle / vaxscr.c < prev    next >
C/C++ Source or Header  |  1995-02-07  |  2KB  |  180 lines

  1. #include "vaxconio.h"
  2. #define false 0
  3. #define true (!false)
  4. int vx_top=1,vx_bot=24;
  5. textattr()
  6. {}
  7. kbhit()
  8. {return false;}
  9. abort_key()
  10. {
  11.     return false;
  12. }
  13. delay(int i)
  14. {}
  15.  
  16. window(int left,int top, int right, int bottom)
  17. {
  18.     if (left==1 && top==1 && bottom==25) {
  19.         printf("\x1b[%d;%dr",1,24);
  20.     }
  21.     vx_top = top;
  22.     vx_bot = bottom;
  23. }
  24. scr_dots(int i)
  25. {
  26. }
  27. scr_gets(char *x)
  28. {
  29.     gets(x);
  30. }
  31. clreol()
  32. {
  33.     printf("\x1b[K");
  34. }
  35. clrscr()
  36. {
  37.     printf("\x1b[2J");
  38. }
  39. cputs(char *line)
  40. {
  41.     printf("%s",line);
  42. }
  43. scr_left(int i)
  44. {
  45.     if (i<=0) return;
  46.     printf("\x1b[%dD",i);
  47. }
  48. scr_right(int i)
  49. {
  50.     if (i<=0) return;
  51.     printf("\x1b[%dC",i);
  52. }
  53. int vx_curx,vx_cury;
  54. gotoxy(int x, int y)
  55. {
  56.     y = y + vx_top - 1;
  57.     if (y>vx_bot) y=vx_bot;
  58.     if (y<vx_top) y=vx_top;
  59.     if (y>25) y=24;
  60.     vx_curx = x; vx_cury = y;
  61.     printf("\x1b[%d;%dH",y,x);
  62. }
  63. insline()
  64. {
  65.     scr_savexy();
  66.     printf("\x1b[%d;%dr",vx_cury,vx_bot);
  67.     printf("\x1b[%d;%dH\x1bM",vx_cury,1);
  68.     scr_restorexy();
  69. }
  70. delline()
  71. {
  72.     scr_savexy();
  73.     printf("\x1b[%d;%dr",vx_cury,vx_bot);
  74.     printf("\x1b[%d;%dH\x1b%c",vx_bot,1,'D');
  75.     scr_restorexy();
  76. }
  77. putch(int char_val)
  78. {
  79.     printf("%c",char_val);
  80. }
  81. scr_refresh()
  82. {
  83. }
  84. int scr_getch()
  85. {
  86.     return getch();
  87. }
  88. scr_init()
  89. {
  90.     printf("\x1b=");
  91. }
  92.  
  93. screen_save()
  94. {}
  95. screen_restore()
  96. {
  97.     clrscr();
  98.     gotoxy(1,1);
  99. }
  100. int vx_topsave,vx_botsave;
  101. scr_savexy()
  102. {
  103.     vx_topsave = vx_top;
  104.     vx_botsave = vx_bot;
  105.     printf("\x1b\x37");
  106. }
  107. scr_restorexy()
  108. {
  109.     printf("\x1b\x38");
  110.     vx_top = vx_topsave;
  111.     vx_bot = vx_botsave;
  112. }
  113. scr_end()
  114. {
  115.     printf("\x1b>");
  116. }
  117.  
  118. gettextinfo(struct text_info *r)
  119. {
  120.     r->curx = 1;
  121.     r->cury = 1;
  122.     r->wintop = vx_top;
  123. }
  124.  
  125.  
  126. textbackground(int color_num)
  127. {}
  128. textcolor(int colornum)
  129. {}
  130.  
  131. int vscrcolor = 0;
  132. scr_norm()  /* yellow on blue */
  133. {
  134.     if (vscrcolor==1) return;
  135.     vscrcolor = 1;
  136.     printf("\x1b[0m");
  137. }
  138. scr_inv()   /* black on white */
  139. {
  140.     if (vscrcolor==2) return;
  141.     if (vscrcolor != 1) printf("\x1b[0m");
  142.     vscrcolor = 2;
  143.     printf("\x1b[1m"); /* hiligh */
  144. }
  145. scr_grey()  /* black on grey */
  146. {
  147.     if (vscrcolor==3) return;
  148.     if (vscrcolor != 1) printf("\x1b[0m");
  149.     vscrcolor = 3;
  150.     printf("\x1b[7m"); /* inverse */
  151. }
  152. scr_isblackwhite()
  153. {
  154.     return true;
  155. }
  156. scr_menubg()
  157. {
  158.     scr_norm();
  159. }
  160. scr_menuval()
  161. {
  162.     scr_inv();
  163. }
  164. scr_menuhi()
  165. {
  166.     scr_grey();
  167. }
  168.  
  169. #include <descrip.h>
  170. vax_edt(char *s)     /* call the vax EDT editor */
  171. {
  172.     $DESCRIPTOR(sdesc,"");
  173.     sdesc.dsc$a_pointer = s;
  174.     sdesc.dsc$w_length = strlen(s);
  175.     edt$edit(&sdesc,&sdesc);
  176. }
  177.  
  178.  
  179.  
  180.